import load2

allClass={}

for i in range(1,1091):
    Class = load2.getCell(i,load2.Class)
    if not Class in allClass.keys():
        allClass[Class]=[]
    Number = load2.getCell(i,load2.Number)
    Score = load2.getCell(i,load2.totScore)
    SciScore = load2.getCell(i,load2.SciScore)
    SchoolDiff = load2.getCell(i,load2.SchoolDiff)
    if Score=='':
        allClass[Class].append([Number, 0, -1])
    else:
        allClass[Class].append([Number,float(Score),float(SciScore),float(SchoolDiff)])

_Number=0
_Score=1
_SciScore=2
_Diff=3

for cname,c in allClass.items():
    sumScore = 0
    sumSciScore = 0
    sumDiff = 0
    for s in c:
        sumScore+=s[_Score]
        sumSciScore+=s[_SciScore]
        sumDiff+=s[_Diff]
    print(cname+','+repr(sumScore/len(c))+','+repr(sumSciScore/len(c))+','+repr(sumDiff/len(c)))
